-
Notifications
You must be signed in to change notification settings - Fork 260
Prefix on NIC v6 support #3526
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prefix on NIC v6 support #3526
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request adds IPv6 support to Azure Container Networking by enhancing metadata retrieval, updating network container contracts with IPFamily and gateway IPv6 fields, and modifying IPAM and REST server logic accordingly.
- Update the IMDS client to retrieve and log network interface metadata including MAC addresses.
- Enhance network container structures to include IPFamilies and gateway IPv6 addresses.
- Revise IPAM, REST server, and delegated NIC assignment to accommodate IPv6 and improve logging.
Reviewed Changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| cns/imds/client.go | Added network interface structs and a new method to get interface metadata; modified GetVMUniqueID to call this method. |
| cns/kubecontroller/nodenetworkconfig/conversion.go | Introduced delegated NIC IP assignment and associated logging. |
| cns/NetworkContainerContract.go | Added IPFamilies field and GatewayIPv6Address to contract structures. |
| cns/restserver/util.go | Updated hostVersion assignment and added additional logging. |
| cns/kubecontroller/nodenetworkconfig/conversion_linux.go | Propagated IPFamilies support in NC request creation. |
| cns/restserver/ipam.go | Modified IP assignment logic to use IPFamily as key for available IPs. |
| azure-ipam/ipam.go | Updated IPAM plugin to log and process interface and gateway info from the CNS response. |
| azure-ipam/ipconfig/ipconfig.go | Modified response processing to return gateway IPs alongside pod IPs. |
| cns/restserver/internalapi_test.go | Updated test generation to include IPFamilies. |
| cns/service/main.go | Added logging around IMDS calls and refined CRD update logic. |
| cns/restserver/restserver.go | Added an IPFamilies field to the HTTPRestService structure. |
Files not reviewed (1)
- go.mod: Language not supported
Comments suppressed due to low confidence (3)
cns/imds/client.go:124
- The error from getInstanceInterfaceMacaddress is wrapped but not returned, which may lead to silent failures. Return the wrapped error or handle it appropriately.
if err != nil { errors.Wrap(err, "error getting IMDS interface metadata") }
cns/imds/client.go:205
- [nitpick] Consider replacing fmt.Println with the consistent logging mechanism (e.g. logger.Printf) to ensure uniform error logging across the codebase.
fmt.Println("Error reading response:", err)
cns/kubecontroller/nodenetworkconfig/conversion.go:131
- The error from nl.AddIPAddress is wrapped but not returned, which can cause silent failures during IP assignment. Return the wrapped error to handle the failure correctly.
if err != nil { errors.Wrapf(err, "failed to assign IP to delegated NIC") }
b5f49a2 to
573f656
Compare
|
@kadevu please update PR description and fix all pipeline failures |
6cdc585 to
5b7d069
Compare
|
|
||
| // Get Pod IP and gateway IP from ip config response | ||
| podIPNet, err := ipconfig.ProcessIPConfigsResp(resp) | ||
| podIPNet, gatewayIP, err := ipconfig.ProcessIPConfigsResp(resp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what this gatewayIP is? why its required?
| cniResult.Interfaces = []*types100.Interface{} | ||
| seenInterfaces := map[string]bool{} | ||
|
|
||
| for _, podIPInfo := range resp.PodIPInfo { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comment to clarify that we need to do dedup as there is one podipinfo for each of the ipfamily
|
This pull request is stale because it has been open for 2 weeks with no activity. Remove stale label or comment or this will be closed in 7 days |
|
This pull request is stale because it has been open for 2 weeks with no activity. Remove stale label or comment or this will be closed in 7 days |
|
Pull request closed due to inactivity. |
Reason for Change:
This PR has changes specific to Prefix on NICv6
CNS
--Consuming PrimaryIPv6, GatewayIPv6, MacAddress (DeletedNIC) from NNC CRD because of dualstack NC
--IP allocation: Assign IPs of each IPFamily as part of RequestIPs api request
IPAM
--Change RequestIPs response parsing to read GatewayIPv6 and MacAddress
--Populates Interfaces with MacAddress which is used by CNI to plumb routes to send traffic
Requirements:
Notes: